﻿using System;
using System.Collections.Generic;
using System.Text;

namespace org.apache.commons.lang3.builder
{
    public class ToStringBuilder
    {
        StringBuilder sbt;
        public ToStringBuilder(object p1,object p2) {
            sbt = new StringBuilder();
            if (p1 is IConvertible)
            {
                sbt.Append(p1 + ",");
            }else
            sbt.Append(p1.GetType().Name + ",");
        }
        public ToStringBuilder append(object name,object value) {
            sbt.Append($"{name}:{value},");
            return this;
        }
        public override string ToString()
        {
            return sbt.ToString().TrimEnd(',');
        }
    }
}
